import request from "./index.js";
import store from '@/store'
import {
	url
} from './confing';
// 获取签名随机数
export const getRandomNum = (data) => {
	return request.get(`${url}/webapi/getRandomNum`, {
		data: data
	});
}
//判断是否绑定推荐人
export const getreferrer = (data) => {
	return request.get(`${url}/member/member/getreferrer`, {
		data: data
	});
}
//登录
export const metaLogin = (data) => {
	return request.post(`${url}/webapi/login`, {
		data: data
	});
}
//获取账户资产 
export const getAssets = (data) => {
	return request.get(`${url}/webapi/user/getAssets`, {
		data: data
	});
}

//获取入金地址 
export const getPledgeAddress = (data) => {
	return request.get(`${url}/webapi/user/getPledgeAddress`, {
		data: data
	});
}

//获取账户资产明细 
export const getAssetsList = (data) => {
	return request.get(`${url}/webapi/user/getAssetsList`, {
		data: data
	});
}


export const getMyView = (data) => {
	return request.get(`${url}/webapi/user/getMyView`, {
		data: data
	});
}
//获取团队信息 
export const getTeamView = (data) => {
	return request.get(`${url}/webapi/user/getTeamView`, {
		data: data
	});
}

//动态收益列表GET：webapi/user/getGiftLog
export const getGiftLog = (data) => {
	return request.get(`${url}/webapi/user/getGiftLog`, {
		data: data
	});
}
//提现 
export const withdraw = (data) => {
	return request.post(`${url}/webapi/pledge/withdraw`, {
		data: data
	});
}
 //入金创建订单
export const pledgepledge = (data) => {
	return request.post(`${url}/webapi/pledge/pledge`, {
		data: data
	});
}
//入金-查询订单状态 
export const getPledgeStatus = (data) => {
	return request.post(`${url}/webapi/pledge/getPledgeStatus`, {
		data: data
	});
}

//获取档位列表GET：webapi/game/getGameInfo
export const getGameInfo = (data) => {
	return request.get(`${url}/webapi/game/getGameInfo`, {
		data: data
	});
}

//获取游戏历史记录GET
export const getGameLog = (data) => {
	return request.get(`${url}/webapi/game/getGameLog`, {
		data: data
	});
}

//游戏-创建订单POST：
export const toGame = (data) => {
	return request.post(`${url}/webapi/game/toGame`, {
		data: data
	});
}

//游戏-查询订单状态POST：
export const getGameResult = (data) => {
	return request.post(`${url}/webapi/game/getGameResult`, {
		data: data
	});
}
//游戏-查询当前状态GET：
export const getGameStatus = (data) => {
	return request.get(`${url}/webapi/game/getGameStatus`, {
		data: data
	});
}
//手动结束游戏POST：
export const endGame = (data) => {
	return request.post(`${url}/webapi/game/endGame`, {
		data: data
	});
}

// 我的团队
export const myteam = (data) => {
	return request.post(`${url}/v1/user/teams`, {
		data: data
	});
}
// 获取随机数


export const getcodeapi = (data) => {
	return request.post(`${url}/v1/user/getcode`, {
		data: data
	});
}

// 登录


export const metamasklogin = (data) => {
	return request.post(`${url}/v1/user/metamasklogin`, {
		data: data
	});
}

// 首页数据

export const gethomeindex = (data) => {
	return request.post(`${url}/v1/user/index`, {
		data: data
	});
}


//查询绑定
export const getBindaddress = (data) => {
	return request.get(`${url}/webapi/user/getBind`, {
		data: data
	});
}
// 绑定 
export const userbind = (data) => {
	return request.post(`${url}/webapi/user/bind`, {
		data: data
	});
}


//获取首页质押总量、收益率
export const getPledgeView = (data) => {
	return request.get(`${url}/webapi/user/getPledgeView`, {
		data: data
	});
}
// 结束质押 
export const endPledge = (data) => {
	return request.post(`${url}/webapi/pledge/endPledge`, {
		data: data
	});
}




//nft/buyBlindbox购买盲盒操作
export const buyBlindbox = (data) => {
	return request.post(`${url}/member/nft/buyBlindbox`, {
		data: data
	});
}

//复投/余额入金 
export const balancePledge = (data) => {
	return request.post(`${url}/webapi/pledge/balancePledge`, {
		data: data
	});
}



// 获取提现记录 
export const getWithdraw = (data) => {
	return request.get(`${url}/webapi/user/getWithdraw`, {
		data: data
	});
}


//直推人列表 webapi/user/getInviteList
export const getInviteList = (data) => {
	return request.get(`${url}/webapi/user/getInviteList`, {
		data: data
	});
}
// 获取兑换比例 
export const getCoinRatio = (data) => {
	return request.get(`${url}/webapi/user/getCoinRatio`, {
		data: data
	});
}
//兑换
export const coinRatio = (data) => {
	return request.post(`${url}/webapi/pledge/coinRatio`, {
		data: data
	});
}

//创建钱包兑换单  
export const createCoinRatio = (data) => {
	return request.post(`${url}/webapi/pledge/createCoinRatio`, {
		data: data
	});
}
//更新钱包兑换单  
export const updateCoinRatio = (data) => {
	return request.post(`${url}/webapi/pledge/updateCoinRatio`, {
		data: data
	});
}
//● 查询钱包兑换单  
export const getRatioStatus = (data) => {
	return request.post(`${url}/webapi/pledge/getRatioStatus`, {
		data: data
	});
}